
#ifndef WISHMASTER_CAPTCHAFETCHER_H
#define WISHMASTER_CAPTCHAFETCHER_H

#include <QObject>
#include <QVariant>
#include "components/chan.h"
#include "components/threadid.h"
#include "misc.h"

namespace Wishmaster
{
	class Connector;
	class WISHMASTER_EXPORT CaptchaFetcher : public QObject
	{
		Q_OBJECT
	public:
		virtual ~CaptchaFetcher() {}

		virtual QString id() = 0;
		virtual CaptchaFetcher* clone(Connector* connector, const QVariantMap& params) = 0;

		virtual void fetchCaptcha(const ThreadId& threadId) = 0;
		virtual void processRequest(const PostDescriptor& post, const QString& captcha, const RequestPtr& request) = 0;

	signals:
		void captcha(const ThreadId& id, const QByteArray& arr);
	};
}

Q_DECLARE_INTERFACE(Wishmaster::CaptchaFetcher, "com.googlecode.wishmaster.CaptchaFetcher/1.0")

#endif

